package cn.crce.cloud9.simple;

import javax.swing.*;

/**
 * @author OnCloud9
 * @description
 * @project NRCE-TEST
 * @date 2022年09月10日 上午 11:11
 */
public class Case40 {
    public static void main(String[] args) {
        Person3 p = new Person3("Zhao",20);
        Student3 s = new Student3("Wang",18,"Cambridge");
        System.out.println(p);
        System.out.println(s);
    }
}


class Student3 extends Person3 {

    private String school;

    public Student3(String name, int age, String s) {
        //*********Found********
        super(name, age);
        school = s;
    }

    public String toString() {
        //*********Found********
        return super.toString() + "     School: " + school;
    }
}
class Person3 {

    private String name;
    private int age;

    public Person3(String name, int age) {
        //*********Found********
        this.name = name;
        //*********Found********
        this.age = age;
    }

    public void setName(String n) {
        //*********Found********
        this.name= n;
    }

    public String toString() {
        return "Name: " + name + "     Age: " + age;
    }
}
